home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / The Hacks! / COSEmulator / COSEmulator- SRC / headers / Blitters.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-21  |  3.9 KB  |  116 lines  |  [TEXT/CWIE]

  1. #ifndef _Blitters_h_
  2. #define _Blitters_h_
  3.  
  4. /*
  5.  
  6. resolution + color switching is handled OS specific routines in the mode manager
  7. after the game starts and it is connected to the server and just after it ends and is
  8. disconnected from the server
  9.  
  10. also the fade in intro should be handled by OS specific routines, no point int trying 
  11. to have an empty function do it
  12.  
  13.  
  14. When you pass stuff to draw it asumes it is a 640x480 screen, even if it isnt. 
  15. It does this by having coordinates added at the last minute when it is drawn
  16.  
  17. ALL GRAPHICS IN THE GAME ARE IN 256 COLORS
  18.  
  19. */
  20.  
  21.  
  22.  
  23. #include "GameTypes.h"
  24. #include "ColorConstants.h"
  25. #include <QDOffscreen.h>
  26.  
  27.  
  28. typedef struct
  29. {
  30.     rect            Bounds;
  31.     PixMapHandle     PixMap;
  32.     GWorldPtr        GWorld;
  33.  
  34. } myMacOSOffScreen;
  35.  
  36. // make it so I can use it as a generic thing
  37. typedef     WindowPtr            WindowPtr;    
  38. typedef     myMacOSOffScreen    OffScreen;
  39.  
  40.  
  41. // buffer data types
  42. // this is VERY os specific
  43. class    OffScreenBuff
  44. {
  45. public:
  46.     OffScreenBuff( void );
  47.     ~OffScreenBuff( void );
  48.     
  49.     Boolean    LoadPicBuff( ushort picID );
  50.     Boolean    NewBuff( const rect &size );
  51.     Boolean    NewBuff( ushort    width , ushort height );
  52.     
  53.     ushort    *GetSrcPtr( void );        // returns the base pointer to the off screen
  54.     ulong    GetRowSize( void );        // Get the size of the row in the buffer
  55.     rect    GetBoundsSize( void );    // find out how big it is
  56.     
  57.     OffScreen    *GetOffScreen( void );    
  58.     
  59.     void    DeleteBuff( void );
  60. private:
  61.  
  62.     
  63.     
  64.     OffScreen    theOffScreen;
  65.     Boolean        declared;
  66.     
  67. };
  68.  
  69. // drawing options for DrawGeneric
  70.  
  71. #define        kDrawTransparent    0x0001    // if this bit true dont draw the transparent color
  72. #define        kDrawTranslucent    0x0002    // blend together the two colors, with the insensity specified by more
  73. #define        kDrawColorize        0x0004    // it replaces all but the clear color with the color specified
  74. #define        kDrawCrop1            0x0008  // draw it croped
  75. #define        kDrawCrop2            0x0010    // draw it croped , 2nd way
  76. #define     kDrawInverse        0x0020    // draws it with the inverse color
  77. #define        kDrawTint            0x0040    // draw it tinted with the color specified at mag
  78. // other utilities
  79.     void    PaintRect(        OffScreenBuff *srcBuff, const rect *src , ushort color );
  80. // drawing routines
  81.     int        DrawGeneric(    OffScreenBuff *srcBuff, const rect *src , 
  82.                             OffScreenBuff *destBuff , const rect *dest , const rect *destClip ,
  83.                             ushort    options , uchar more , ushort color );
  84.                             
  85.     void    DrawPicture(     OffScreenBuff *srcBuff, const rect *src , 
  86.                             OffScreenBuff *destBuff , const rect *dest ); // strait copy
  87.     void    DrawPictureInverse(     OffScreenBuff *srcBuff, const rect *src ,
  88.                             OffScreenBuff *destBuff , const rect *dest );
  89.     void    DrawTranslu( OffScreenBuff *srcBuff, const rect *src , 
  90.                          OffScreenBuff *destBuff , const rect *dest , uchar    mag);
  91.     void    DrawPictureTint(     OffScreenBuff *srcBuff, const rect *src ,
  92.                                 OffScreenBuff *destBuff , const rect *dest ,
  93.                                 uchar mag , ushort color );                         
  94.     void    DrawClearPic(     OffScreenBuff *srcBuff, const rect *src , 
  95.                             OffScreenBuff *destBuff , const rect *dest );    // copies everthing but clear color 
  96.     void    DrawClearPicColor(  OffScreenBuff *srcBuff, const rect *src , 
  97.                             OffScreenBuff *destBuff , const rect *dest ,
  98.                             ushort    color );
  99.                                             
  100.     void    DrawClearTranslu( OffScreenBuff *srcBuff, const rect *src , 
  101.                                         OffScreenBuff *destBuff , const rect *dest , uchar    mag);
  102.  
  103.     void    DrawClearPicTint( OffScreenBuff *srcBuff, const rect *src , 
  104.                                         OffScreenBuff *destBuff , const rect *dest ,
  105.                                         uchar mag , ushort color );
  106.  
  107.     void    DrawGenericCliped1( OffScreenBuff *srcBuff, const rect *src ,
  108.                             OffScreenBuff *destBuff , const rect *dest , const rect *destClip ,
  109.                             ushort    options , uchar more , ushort color );
  110.  
  111.     void    DrawClipedPicture2(     OffScreenBuff *srcBuff, const rect *src , 
  112.                             OffScreenBuff *destBuff , const rect *dest , const rect *destClip);    // copies everthing but clear color 
  113.  
  114.     void    DrawFastPicture640x(     OffScreenBuff *srcBuff, const rect *src ,
  115.                                         OffScreenBuff *destBuff , const rect *dest );
  116. #endif